package com.yunxi.service.localService.impl.vip;

import com.github.pagehelper.PageInfo;
import com.yunxi.core.page.PageHelperPlus;
import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.core.util.BeanTools;
import com.yunxi.dao.vip.StoVehicleExpMapper;
import com.yunxi.model.vip.StoVehicleExp;
import com.yunxi.service.localService.vip.StoVehicleExpService;
import com.yunxi.vip.pojo.StoVehicleExpVO;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 体验车库存 服务实现类
 * </p>
 *
 * @author 
 * @since 2019-09-25
 */
@Service
public class StoVehicleExpServiceImpl extends ServiceImplPlus<StoVehicleExpMapper, StoVehicleExp> implements StoVehicleExpService {

    @Override
    public StoVehicleExp getByOrderVehicleId(String orderCarId) {
        return baseMapper.getByOrderVehicleId(orderCarId);
    }

    @Override
    public StoVehicleExpVO getByCas(String expId) {
        return baseMapper.getByCas(expId);
    }

    @Override
    public PageInfo<StoVehicleExpVO> pageByCheckSales(StoVehicleExpVO vo, Integer pageNum, Integer pageSize) {
        Map map = BeanTools.bean2map(vo);
        PageHelperPlus.startPage(pageNum,pageSize);
        List<StoVehicleExpVO> list = baseMapper.pageByCheckSales(map);
        PageInfo<StoVehicleExpVO> pageInfo = new PageInfo<StoVehicleExpVO>(list);
        return pageInfo;
    }

    @Override
    public void checkSales(StoVehicleExpVO stoVehicleExpVO) {
        baseMapper.checkSales(stoVehicleExpVO);
    }

    @Override
    public StoVehicleExpVO getByOrderCarId(String orderCarId) {
        return baseMapper.getByOrderCarId(orderCarId);
    }
}
